#include <iostream>
#include <cstdlib>
#include <cstring>
using namespace std;

const int maxn = 3001;
bool exist[maxn];

bool judge(int n);

int main()
{
	int n;
	while (cin >> n) {
		if (judge(n)) cout << "Jolly" << endl;
		else		  cout << "Not jolly" << endl;
	}
	return 0;
}

bool judge(int n)
{
	bool flag = true;
	memset(exist, 0, sizeof(exist[0]) * n);
	int tmp, now;
	cin >> tmp;
	for (int i = 1; i < n; ++i) {
		cin >> now;
		tmp = abs(now - tmp);
		if (exist[tmp]) flag = false;
		exist[tmp] = true;
		tmp = now;
	}
	return flag;
}
